import { Input } from 'antd'
import React from 'react'

export default function SearchItem(props) {
    const { title, onFinish, name } = props

    const handleOnChange = (e) => {
        onFinish && onFinish(e.target.value, name)
    }

    return (
        <div style={{ display: 'flex', alignItems: 'center' }}>
            <span style={{ whiteSpace: 'nowrap', marginRight: '5px' }}>{title}</span>
            <Input placeholder={`请输入${title}进行搜索`} onPressEnter={handleOnChange} allowClear />
        </div>
    )
}